package com.shiguiwu.springmybatis.designpattern.observe.service;

import lombok.extern.slf4j.Slf4j;

/**
 * @description: 小轿车摇号服务
 * @author: stone
 * @date: Created by 2021/9/3 14:34
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.designpattern.observe.service
 */
@Slf4j
public class MinibusTargetService {

    /**
     * 模拟摇号系统
     * @param userId
     * @return
     */
    public String lottery(String userId) {

        return userId.hashCode() %2 ==0
                ? String.format("恭喜你，编号是%s，在本次摇号中签",userId)
                :String.format("很遗憾，编号是%s，在本次摇号未中签或摇号资格已过期",userId);
    }



}
